package redMoney;

import java.util.ArrayList;
import java.util.Random;

public class Menmber extends PiblicUser {
    public Menmber() {
    }

    public Menmber(String name, Integer money) {
        super(name, money);
    }
    public void receive(ArrayList<Integer>list){
        int anInt = new Random().nextInt(list.size());
        //删掉集合中抽到的元素
        Integer remove = list.remove(anInt);
        //原来的余额
        Integer money = super.getMoney();
        //收到红包之后的余额
        super.setMoney(money+remove);
    }
}
